import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login'

Vue.use(VueRouter)

const routes = [
    {
        /*路由路径为/则重定向到/login路由*/
        path: "/",
        redirect: "/login"
    },
    {
        path: "/login",
        name: "Login",
        component: Login
    },
    {
        path: "/home",
        name: "Home",
        component: ()=>import("../views/Home.vue"),
        //home路由下得子路由有哪些
        children:[
            {
                path:"/acl/role/list",
                component: ()=>import("../views/acl/role/List.vue")
            }
        ]
    },



    // {
    //   path: '/',
    //   name: 'home',
    //   component: HomeView
    // },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   // component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
    // }
]

const router = new VueRouter({
    //mode: 'history',
    routes
})

export default router
